#import packages
import cv2

#define class
class ShapeDetector:
	def __init__(self):
		pass
	#initialize 
	def detect(self,c):
		NumOfLen = 0
		#count the perimeter of the shape
		peri = cv2.arcLength(c, True)
		#approximate points.
		appx = cv2.approxPolyDP(c, 0.04*peri, True)
		#output
		NumOfLen = len(appx)
		return NumOfLen
	
		
